<?php 
class Myblog_Controller_Action_Helper_Navigation extends Zend_Controller_Action_Helper_Abstract
{
protected $_container;
	public function __construct(Zend_Navigation $container=null)
	{
		if(null !==$container)
		{
		$this->_container=$container;
		}
	}
	public function preDispatch()
	{
	$active=$this->getContainer()
		->findBy('uri',$this->getRequest()->getRequestUri());
		if(!empty($active)){
		$active->class="selected";
		$active->active=true; 
		}
		
	}
	public function getContainer()
	{
		if(null===$this->_container){
		$this->_container=Zend_Registry::get('Zend_Navigation');
		}
		if(null===$this->_container){
		throw new RuntimeException('Navigation container unvailable');
		}
	return $this->_container;
	}

}
